Skip to content

New flight: fill responsible person and reason for visit - #55

Merged
roznet merged 1 commit into
mainfrom
new-flight-responsible-reason
Oct 31, 2026
Merged

roznet merged 1 commit into
mainfrom
new-flight-responsible-reason

Conversation

@roznet

@roznet roznet commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Why

The responsible person and the reason for visit rarely change between flights, but no import path filled them. The clipboard, Weather and Autorouter imports cleared them, the "Same as …" chip didn't copy them, and repeating a previous flight dropped the reason. So both had to be re-entered in the flight editor after every flight was created.

What

  • Reason for visit defaults to Based when the destination is the aircraft's usual base, and Short Term Visit otherwise, including flights leaving the base (Flight.defaultReasonForVisit). If the aircraft has no base on file, it uses the copied flight's value.
  • Responsible person defaults to the most recent flight's responsible person, if that person is on this flight; otherwise the first crew member (PeopleSuggestion.defaultResponsiblePerson).
  • "Same as …" / "Choose another flight…" also copy the source flight's responsible person, reason and document choices (PeopleSuggestion.source).
  • People step: a new "Flight Details" section with both as editable rows, already filled in.
  • Fixes: repeating a previous flight now carries the reason for visit and the chosenDocNumbers. A route import only clears a responsible person that an earlier import set, the same rule the crew already follows.

The design doc designs/flight-import.md is updated.

Testing

  • Unit tests: flyfun-formsTests pass, including new tests for the reason rule, the responsible-person default and the chip's source flight.
  • XCUI: 10 of 11 passed in the full run. testPasteFlightPlanFillsRouteAndCreatesAircraft tapped Create Flight before the people step had drawn it; it now waits for the button and passes. The full UI suite was not re-run after that fix.
  • Labels reuse strings that are already translated. The reason values themselves ("Based", …) were never in the string catalog; that predates this PR.

🤖 Generated with Claude Code

Both rarely change between flights, but no import path set them, so
they were re-entered in the flight editor after every creation.

- Reason for visit defaults to "Based" when the destination is the
  aircraft's usual base, "Short Term Visit" otherwise; falls back to the
  copied flight's value when the aircraft has no base.
- Responsible person defaults to the most recent one who is aboard,
  else the first crew member.
- "Same as ..." and "Choose another flight..." carry the source
  flight's responsible person, reason and document choices.
- Both shown as editable rows on the people step.
- Repeating a previous flight now carries reason for visit and
  document choices; a route import only clears a responsible person
  an import set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roznet
roznet merged commit 0fffbb2 into main Oct 31, 2026
3 of 4 checks passed
@roznet
roznet deleted the new-flight-responsible-reason branch October 31, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant